package com.biscuit.page.basicservice.conf.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * @author mazihao
 * @createTime 2024/4/1 9:50
 */
@Configuration
public class FileUploadConfig {

    @Bean
    public CommonsMultipartResolver commonsMultipartResolver() {
        CommonsMultipartResolver resolver = new CommonsMultipartResolver();
        // 设置最大上传文件大小
        resolver.setMaxUploadSizePerFile(12 * 1024 * 1024); // 5MB
        return resolver;
    }

}
